package com.ruoyi.web.controller.dispatch;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.DispatchOneHourPressureAmplitudeStatistics;
import com.ruoyi.system.service.IDispatchOneHourPressureAmplitudeStatisticsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 1 小时压力振幅统计Controller
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@RestController
@RequestMapping("/system/dispatchOneHourPressureAmplitudeStatistics")
public class DispatchOneHourPressureAmplitudeStatisticsController extends BaseController
{
    @Autowired
    private IDispatchOneHourPressureAmplitudeStatisticsService dispatchOneHourPressureAmplitudeStatisticsService;

    /**
     * 查询1 小时压力振幅统计列表
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchOneHourPressureAmplitudeStatistics:list')")
    @GetMapping("/list")
    public TableDataInfo list(DispatchOneHourPressureAmplitudeStatistics dispatchOneHourPressureAmplitudeStatistics)
    {
        startPage();
        List<DispatchOneHourPressureAmplitudeStatistics> list = dispatchOneHourPressureAmplitudeStatisticsService.selectDispatchOneHourPressureAmplitudeStatisticsList(dispatchOneHourPressureAmplitudeStatistics);
        return getDataTable(list);
    }

    /**
     * 导出1 小时压力振幅统计列表
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchOneHourPressureAmplitudeStatistics:export')")
    @Log(title = "1 小时压力振幅统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DispatchOneHourPressureAmplitudeStatistics dispatchOneHourPressureAmplitudeStatistics)
    {
        List<DispatchOneHourPressureAmplitudeStatistics> list = dispatchOneHourPressureAmplitudeStatisticsService.selectDispatchOneHourPressureAmplitudeStatisticsList(dispatchOneHourPressureAmplitudeStatistics);
        ExcelUtil<DispatchOneHourPressureAmplitudeStatistics> util = new ExcelUtil<DispatchOneHourPressureAmplitudeStatistics>(DispatchOneHourPressureAmplitudeStatistics.class);
        util.exportExcel(response, list, "1 小时压力振幅统计数据");
    }

    /**
     * 获取1 小时压力振幅统计详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchOneHourPressureAmplitudeStatistics:query')")
    @GetMapping(value = "/{oneHourPressureAmplitudeStatisticsId}")
    public AjaxResult getInfo(@PathVariable("oneHourPressureAmplitudeStatisticsId") Long oneHourPressureAmplitudeStatisticsId)
    {
        return success(dispatchOneHourPressureAmplitudeStatisticsService.selectDispatchOneHourPressureAmplitudeStatisticsByOneHourPressureAmplitudeStatisticsId(oneHourPressureAmplitudeStatisticsId));
    }

    /**
     * 新增1 小时压力振幅统计
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchOneHourPressureAmplitudeStatistics:add')")
    @Log(title = "1 小时压力振幅统计", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DispatchOneHourPressureAmplitudeStatistics dispatchOneHourPressureAmplitudeStatistics)
    {
        return toAjax(dispatchOneHourPressureAmplitudeStatisticsService.insertDispatchOneHourPressureAmplitudeStatistics(dispatchOneHourPressureAmplitudeStatistics));
    }

    /**
     * 修改1 小时压力振幅统计
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchOneHourPressureAmplitudeStatistics:edit')")
    @Log(title = "1 小时压力振幅统计", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DispatchOneHourPressureAmplitudeStatistics dispatchOneHourPressureAmplitudeStatistics)
    {
        return toAjax(dispatchOneHourPressureAmplitudeStatisticsService.updateDispatchOneHourPressureAmplitudeStatistics(dispatchOneHourPressureAmplitudeStatistics));
    }

    /**
     * 删除1 小时压力振幅统计
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchOneHourPressureAmplitudeStatistics:remove')")
    @Log(title = "1 小时压力振幅统计", businessType = BusinessType.DELETE)
	@DeleteMapping("/{oneHourPressureAmplitudeStatisticsIds}")
    public AjaxResult remove(@PathVariable Long[] oneHourPressureAmplitudeStatisticsIds)
    {
        return toAjax(dispatchOneHourPressureAmplitudeStatisticsService.deleteDispatchOneHourPressureAmplitudeStatisticsByOneHourPressureAmplitudeStatisticsIds(oneHourPressureAmplitudeStatisticsIds));
    }
}
